/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package frame;

import dao.DangNhapDAO;
import frame.BanHang.QLCuaHang;
import frame.BanHang.QLDoanhThu;
import frame.BanHang.QLKhuyenMai;
import frame.BanHang.QLPhieuNhapKho;
import frame.CaNhan.FrameDoiMatKhau;
import frame.CaNhan.QLThongTinCaNhan;
import frame.HangHoa.QLDanhMuc;
import frame.HangHoa.QLDonVi;
import frame.HangHoa.QLSanPham;
import frame.Report.ReportFrame;
import frame.Report.ReportSanPham;
import frame.TaiKhoan.PhanQuyen;
import frame.TaiKhoan.QLKhachHang;
import frame.TaiKhoan.QLTaiKhoan;
import java.beans.PropertyVetoException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import net.sf.jasperreports.engine.JRException;
import pojo.Nhanvien;

/**
 *
 * @author Quan
 */
public class MainFrame extends javax.swing.JFrame
{

    private QLSanPham ql_sanpham;
    private QLTaiKhoan ql_taikhoan;
    private QLKhachHang ql_khachhang;
    private ReportFrame report_frame;
    private QLCuaHang ql_cuahang;
    private ReportSanPham rp_sanpham;
    private PhanQuyen phanQuyen;
    private QLKhuyenMai qLKhuyenMai;
    private QLDoanhThu qLDoanhThu;
    private QLPhieuNhapKho qLPhieuNhapKho;
    /**
     * Nhân viên
     */
    private Nhanvien nv;

    public void setNv(Nhanvien nv)
    {
        this.nv = nv;
    }

    public Nhanvien getNv()
    {
        return nv;
    }

    /**
     * Creates new form MainFrame
     */
    public MainFrame(Nhanvien nv)
    {
        initComponents();
        this.nv = nv;
        AnControl();
    }

    public void ShowReportFrame(String title, String file_name, HashMap hm)
    {

        if (this.report_frame == null) {
            this.report_frame = new ReportFrame();
            jdp.add(report_frame);
            try {
                this.report_frame.ShowWithMaximunSize();
            } catch (PropertyVetoException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            this.report_frame.setVisible(true);
        }
        try {
            this.report_frame.LoadReport(title, file_name, hm);
        } catch (SQLException | JRException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void AnControl()
    {
        switch (nv.getLoaitk()) {
            case "Quản lý":

                break;
            case "Bán hàng":
                AnControlBanHang();
                break;
            case "Kho":
                AnControlKho();
                break;
        }
    }

    private void AnControlBanHang()
    {
        jMenu1.setVisible(false);
    }

    private void AnControlKho()
    {
        jMenu1.setVisible(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jdp = new javax.swing.JDesktopPane();
        jp_button = new javax.swing.JPanel();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        openMenuItem = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        jMenuItem8 = new javax.swing.JMenuItem();
        jmnkhuyenmai = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        cutMenuItem = new javax.swing.JMenuItem();
        copyMenuItem = new javax.swing.JMenuItem();
        pasteMenuItem = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jmnkhachhang = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmnkh = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jmnkm = new javax.swing.JMenuItem();
        jmndt = new javax.swing.JMenuItem();
        jmncuahangreport = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenuItem2.setText("jMenuItem2");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Quản lý chuỗi điện dân dụng");

        org.jdesktop.layout.GroupLayout jp_buttonLayout = new org.jdesktop.layout.GroupLayout(jp_button);
        jp_button.setLayout(jp_buttonLayout);
        jp_buttonLayout.setHorizontalGroup(
            jp_buttonLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 161, Short.MAX_VALUE)
        );
        jp_buttonLayout.setVerticalGroup(
            jp_buttonLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 0, Short.MAX_VALUE)
        );

        fileMenu.setMnemonic('L');
        fileMenu.setText("Lựa chọn");

        jMenuItem5.setText("Quản Lý Cửa Hàng");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem5);

        jMenuItem7.setText("Quản Lý Doanh Thu");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        fileMenu.add(jMenuItem7);

        openMenuItem.setMnemonic('T');
        openMenuItem.setText("Thoát");
        openMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(openMenuItem);

        menuBar.add(fileMenu);

        jMenu6.setText("Bán Hàng");

        jMenuItem8.setText("Quản Lý Phiếu Nhập");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem8);

        jmnkhuyenmai.setText("Quản lý khuyến mãi");
        jmnkhuyenmai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnkhuyenmaiActionPerformed(evt);
            }
        });
        jMenu6.add(jmnkhuyenmai);

        menuBar.add(jMenu6);

        editMenu.setMnemonic('H');
        editMenu.setText("Kho");

        cutMenuItem.setMnemonic('H');
        cutMenuItem.setText("QL Hàng Hóa");
        cutMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cutMenuItemActionPerformed(evt);
            }
        });
        editMenu.add(cutMenuItem);

        copyMenuItem.setMnemonic('V');
        copyMenuItem.setText("QL Đơn Vị");
        copyMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                copyMenuItemActionPerformed(evt);
            }
        });
        editMenu.add(copyMenuItem);

        pasteMenuItem.setMnemonic('M');
        pasteMenuItem.setText("QL Danh Mục");
        pasteMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pasteMenuItemActionPerformed(evt);
            }
        });
        editMenu.add(pasteMenuItem);

        menuBar.add(editMenu);

        jMenu1.setMnemonic('N');
        jMenu1.setText("Tài Khoản");

        jMenuItem6.setText("Phân Quyền");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem6);

        jMenuItem3.setMnemonic('N');
        jMenuItem3.setText("Nhân Viên");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem3);

        jmnkhachhang.setText("Khách hàng");
        jmnkhachhang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnkhachhangActionPerformed(evt);
            }
        });
        jMenu1.add(jmnkhachhang);

        menuBar.add(jMenu1);

        jMenu2.setText("Báo Cáo");

        jmnkh.setText("Danh mục khách hàng");
        jmnkh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnkhActionPerformed(evt);
            }
        });
        jMenu2.add(jmnkh);

        jMenuItem4.setText("Sản Phẩm");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem4);

        jmnkm.setText("Báo cáo khuyến mãi");
        jmnkm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmnkmActionPerformed(evt);
            }
        });
        jMenu2.add(jmnkm);

        jmndt.setText("Báo cáo doanh thu");
        jmndt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmndtActionPerformed(evt);
            }
        });
        jMenu2.add(jmndt);

        jmncuahangreport.setText("Report Cửa Hàng");
        jmncuahangreport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmncuahangreportActionPerformed(evt);
            }
        });
        jMenu2.add(jmncuahangreport);

        menuBar.add(jMenu2);

        helpMenu.setMnemonic('T');
        helpMenu.setText("Tài Khoản");

        contentsMenuItem.setMnemonic('T');
        contentsMenuItem.setText("Thông Tin Tài Khoản");
        contentsMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                contentsMenuItemActionPerformed(evt);
            }
        });
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setMnemonic('M');
        aboutMenuItem.setText("Đổi Mật Khẩu");
        aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aboutMenuItemActionPerformed(evt);
            }
        });
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jp_button, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jdp, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jp_button, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jdp, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cutMenuItemActionPerformed
        // TODO add your handling code here:
        if (ql_sanpham == null) {
            ql_sanpham = new QLSanPham(nv);
            jdp.add(ql_sanpham);
        }
        try {
            ql_sanpham.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            JOptionPane.showMessageDialog(rootPane, ex.getMessage(), "Thông báo", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_cutMenuItemActionPerformed

    private void copyMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyMenuItemActionPerformed

        QLDonVi qldv = new QLDonVi();
        qldv.setLocationRelativeTo(this);
        qldv.setModal(true);
        qldv.setVisible(true);
    }//GEN-LAST:event_copyMenuItemActionPerformed

    private void pasteMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pasteMenuItemActionPerformed
        // TODO add your handling code here:
        QLDanhMuc qldm = new QLDanhMuc(this.nv);
        qldm.setLocationRelativeTo(this);
        qldm.setModal(true);
        qldm.setVisible(true);
    }//GEN-LAST:event_pasteMenuItemActionPerformed

    private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_openMenuItemActionPerformed

    private void contentsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_contentsMenuItemActionPerformed
        // TODO add your handling code here:
        if (DangNhapDAO.CheckPassword(nv)) {
            QLThongTinCaNhan ql_ttcn = new QLThongTinCaNhan(nv);
            ql_ttcn.setLocationRelativeTo(this);
            ql_ttcn.setVisible(true);
        }
    }//GEN-LAST:event_contentsMenuItemActionPerformed

    private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
        // TODO add your handling code here:
        if (dao.DangNhapDAO.CheckPassword(nv)) {
            FrameDoiMatKhau fdmk = new FrameDoiMatKhau(nv);
            fdmk.setLocationRelativeTo(this);
            fdmk.setVisible(true);
        }

    }//GEN-LAST:event_aboutMenuItemActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        if (DangNhapDAO.LayLoaiToaiKhoan(nv).equals("Quản lý")) {
            if (ql_taikhoan == null) {
                this.ql_taikhoan = new QLTaiKhoan(this.nv);
                jdp.add(ql_taikhoan);
            }
            try {
                ql_taikhoan.ShowWithMaximunSize();
            } catch (PropertyVetoException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        if (this.rp_sanpham == null) {
            rp_sanpham = new ReportSanPham(this, true);
            rp_sanpham.setLocationRelativeTo(this);
        }
        rp_sanpham.setVisible(true);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        if (ql_cuahang == null) {
            ql_cuahang = new QLCuaHang(nv);
            jdp.add(ql_cuahang);
        }
        try {
            ql_cuahang.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            JOptionPane.showMessageDialog(rootPane, ex.getMessage(), "Thông báo", JOptionPane.ERROR_MESSAGE);
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jmncuahangreportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmncuahangreportActionPerformed
        if (this.report_frame == null) {
            this.report_frame = new ReportFrame();
            jdp.add(this.report_frame);
        }

        HashMap hm = new HashMap();
        this.ShowReportFrame("Báo cáo hàng hóa", "src/report/CuaHangReport.jasper", hm);
        try {
            this.report_frame.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmncuahangreportActionPerformed

    private void jmnkhachhangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnkhachhangActionPerformed
        try {
            if (this.ql_khachhang == null) {
                this.ql_khachhang = new QLKhachHang(this.nv);
                jdp.add(this.ql_khachhang);
            }
            this.ql_khachhang.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmnkhachhangActionPerformed

    private void jmnkhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnkhActionPerformed
        if (this.report_frame == null) {
            this.report_frame = new ReportFrame();
            jdp.add(this.report_frame);
        }

        HashMap hm = new HashMap();
        this.ShowReportFrame("Báo cáo khuyến mãi", "src/report/KhachHangReport.jasper", hm);
        try {
            this.report_frame.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmnkhActionPerformed

    private void jmnkhuyenmaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnkhuyenmaiActionPerformed
        if (true) {
            if (this.qLKhuyenMai == null) {
                this.qLKhuyenMai = new QLKhuyenMai(this.nv);
                jdp.add(qLKhuyenMai);
            }
            try {
                qLKhuyenMai.ShowWithMaximunSize();
            } catch (PropertyVetoException ex) {
                Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_jmnkhuyenmaiActionPerformed

    private void jmnkmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmnkmActionPerformed
        if (this.report_frame == null) {
            this.report_frame = new ReportFrame();
            jdp.add(this.report_frame);
        }

        HashMap hm = new HashMap();
        this.ShowReportFrame("Báo cáo khuyến mãi", "src/report/KhuyenMaiReport.jasper", hm);
        try {
            this.report_frame.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmnkmActionPerformed

    private void jmndtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmndtActionPerformed
        if (this.report_frame == null) {
            this.report_frame = new ReportFrame();
            jdp.add(this.report_frame);
        }

        HashMap hm = new HashMap();
        this.ShowReportFrame("Báo cáo khuyến mãi", "src/report/DoanhThuReport.jasper", hm);
        try {
            this.report_frame.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmndtActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
        if (this.phanQuyen == null) {
            this.phanQuyen = new PhanQuyen(this.nv);
            jdp.add(this.phanQuyen);
        }
        try {
            this.phanQuyen.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
        if (this.qLDoanhThu == null) {
            this.qLDoanhThu = new QLDoanhThu(this.nv);
            jdp.add(this.qLDoanhThu);
        }
        try {
            this.qLDoanhThu.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        // TODO add your handling code here:
        if (this.qLPhieuNhapKho == null) {
            this.qLPhieuNhapKho = new QLPhieuNhapKho(this.nv);
            jdp.add(this.qLPhieuNhapKho);
        }
        try {
            this.qLPhieuNhapKho.ShowWithMaximunSize();
        } catch (PropertyVetoException ex) {
            Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            @Override
            public void run()
            {
                new MainFrame(null).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JDesktopPane jdp;
    private javax.swing.JMenuItem jmncuahangreport;
    private javax.swing.JMenuItem jmndt;
    private javax.swing.JMenuItem jmnkh;
    private javax.swing.JMenuItem jmnkhachhang;
    private javax.swing.JMenuItem jmnkhuyenmai;
    private javax.swing.JMenuItem jmnkm;
    private javax.swing.JPanel jp_button;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem pasteMenuItem;
    // End of variables declaration//GEN-END:variables
}
